package com.zimin.cloud.wiki.controller.api;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zimin.cloud.mine.pojo.wiki.business.EbookBO;
import com.zimin.shared.pojo.Result;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 电子书 前端控制器 接口
 * </p>
 *
 * @author zimin
 * @since 2021-10-27 21:02
 */
@RequestMapping("/wiki")
public interface IEbookController {

    String ROUTER_PREFIX = "/ebook";

    /**
     * <p></p>
     *
     * @param ebookBO 电子书列表参数
     * @return com.zimin.cloud.shared.pojo.Result
     * @author zimin
     * @since 2021-11-02 16:55:30
     */
    @GetMapping(ROUTER_PREFIX + "s")
    Result ebookList(Page page, EbookBO ebookBO);

    /**
     * <p>保存电子书</p>
     *
     * @param ebookBO 电子书参数
     * @return com.zimin.cloud.shared.pojo.Result
     * @author zimin
     * @since 2021-11-03 11:42:49
     */
    @PostMapping("/ebook")
    Result saveEbook(@RequestBody EbookBO ebookBO);

    /**
     * <p>修改电子书</p>
     *
     * @param ebookBO 电子书参数
     * @return com.zimin.cloud.shared.pojo.Result
     * @author zimin
     * @since 2021-11-03 11:43:33
     */
    @PutMapping("/ebook")
    Result updateEbook(@RequestBody @Validated EbookBO ebookBO);

    /**
     * <p>根据ID删除电子书</p>
     *
     * @param id ID
     * @return com.zimin.cloud.shared.pojo.Result
     * @author zimin
     * @since 2021-11-03 11:43:54
     */
    @DeleteMapping("/ebook/{id}")
    Result removeById(@PathVariable(value = "id") String id);
}
